<?php
$redis = new Redis();


$redis->connect($config['host'], $config['port']);
// 或者 $redis->connect($config['host'].":".$config['port']); 

//如果有密码这样：
//$redis->auth("sdfsdf"); 

//如果不写这行，默认是0数据库
$redis->select($config['db']);

return $redis;

?>